<?php

namespace App\Models;

use App\Constant;
use Illuminate\Database\Eloquent\Model;

class Wallet extends Model
{
    public function user(){
    	return $this->belongsTo(User::class);
    }

    public function payment()
    {
        return $this->belongsTo(ManualPaymentMethod::class, 'payment_method', 'heading');
    }


    public function paylog()
    {
        return $this->hasOne(PaylogModel::class, 'relate_id', 'id')->whereIn('relate_type', [Constant::PAYLOG_TYPE_RECHARGE, Constant::PAYLOG_TYPE_DEPOSIT]);
    }
}
